<!DOCTYPE html>
<html lang="zh-CN">

<head>
    <meta charset="UTF-8">
    <title>地市指标最优指标</title>
    <link rel="stylesheet" href="../source/bootstrap-3.3.7/css/bootstrap.min.css">
    <link rel="stylesheet" href="../source/bootstrap-table-1.11.1/bootstrap-table.min.css">
    <script src="../source/jquery/jquery-1.10.2.min.js"></script>
    <script src="../source/bootstrap-3.3.7/js/bootstrap.min.js"></script>
    <script src="../source/bootstrap-table-1.11.1/bootstrap-table.js"></script>
    <script src="../source/bootstrap-table-1.11.1/locale/bootstrap-table-zh-CN.min.js"></script>
    <script src="../source/iconfont/iconfont.js"></script>
    <script src="../source/echarts.min.js"></script>
    <!-- <script src="../source/echarts-all.js"></script>-->
    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no">
    <style>
        .icon {
            width: 1em;
            height: 1em;
            vertical-align: -0.15em;
            fill: currentColor;
            overflow: hidden;
            font-size: 20px;
            line-height: 30px;
            margin-right: 0px;
            margin-left: 0px;
        }

        #table1 td {
            height: 30px;
            padding: 6px;
        }

        #table1 thead {
            color: #ffffff;
        }

        .th-inner {
            height: 36px;
            border-radius: 0px;
        }

        .container {
            padding-right: 10px;
            padding-left: 10px;
        }

        .fixed-table-container thead th:first-child {

            border-top-left-radius: 0px;
            -webkit-border-top-left-radius: 0px;

        }
    </style>


</head>
<body>
<div class="container" style="height: 100%;width: 100%;overflow-x: hidden">
    <div class="row" style="height: 18%; background-color: #169BFA;text-align: center;">
        <div class="row" style="height: 50%;position: relative;">
            <div style="width:100%;position: absolute; bottom: 0;">
                <span id="inD_DATA" style="color:#DCF2FF;font-size:xx-large"></span>
                <span style="color:#DCF2FF;"></span>
                        <span id="lasttime_data" style=" margin-right: 0px;">
                            <svg class="icon" aria-hidden="true">
                                <use xlink:href="#icon-jiantou3"></use>
                            </svg>
                        </span>
            </div>
        </div>
        <div class="row" style="height: 40%;position: relative;">
            <div style="width:100%;position: absolute;">
                <span id="iS_Degradation" style="opacity: 0;margin-left: 27%;float:left;padding: 0.125em;width: 4.643em;height:1.429em ; background-image: url(../imgs/img_liehua.png);background-size: 100% 100%;color:#FBDBDD;box-shadow:1px 1px 1px #F47D78;margin-right: 10px;margin-bottom: 1em">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span>
                <span id="time" style="color:#FBDBDD;margin-left:2%;float:left;margin-top: 0.125em "></span>
                <span style="float:right;margin-right: 31%;display:none;background-color: #0072C2;color:#FBDBDD; padding: 1px 5px 1px 5px; "></span>
            </div>
        </div>
        <div class="row" style="height: 30%;position: relative;padding: 10px 50px 10px 50px;">
            <div style="height: 3em;line-height: 3em; margin-top: -20px;background-color: #ffffff;padding:0px 30px 0px 20px;  ">

                        <span style="font-size: large">
                            <svg class="icon" aria-hidden="true" style="background-image: url(../imgs/img_hao.png);background-size: 100% 100%;color:#666666;float: left;margin-right: 10px;margin-top: 0.475em;">
                            </svg>
                            <b style="text-align: left;float: left">全省最优</b>
                        </span>
                <svg class="icon" aria-hidden="true" style="font-size: inherit;color:#A4A4A4;text-align: left">

                    <use xlink:href="#icon-vertical_line"></use>
                </svg>

                <span style="font-size: large;color:#179Bfa;text-align: right;margin-left: 0.625em" id="youini_data">  </span>
            </div>

        </div>

    </div>
    <div class="row" style="text-align: center;padding:5px 30px 2px 30px;margin-top: 2em">
        <div id="tishi" class="row" style="position:relative;">
            <!-- <div style="background-color:#4FCC54;color:#FBDBDD;box-shadow:1px 1px 1px #4FCC54;margin-top: 1em;padding-left: 0.875em;text-align: left">
                <span id="ReMake" style="height: 1.5em;line-height: 1.75em;padding: 0.25em 0em  0.25em 0em;">
                    该指标当前状态良好

                </span>
            </div> -->
            <div  style="background-color: #c6e4fa;color:#000000;box-shadow:1px 1px 1px #4FCC54;margin-right:0.875em;margin-left:0.875em;position: relative">
                <div id="chnageImg" style="height: 1.25em;width:1em;position:absolute;right:0.5em;top:0.8em;z-index:999;background-image:url(../imgs/img_array_right.png);background-size: 100% 100%"></div>
                        <span id="ReMake" style="padding:0.625em  0.825em;width:100%;text-align:left;float: left;background-color: #c6e4fa;color:#000000;line-height:inherit  ">

                        </span>
            </div>
        </div>

    </div>
    <div class="row" style="height: 10%; text-align: center;padding:15px 10px 5px 10px; ">

        <div class="row" style="height: 90%;position: relative;">
            <div style="width:100%;position: absolute; ">

                        <span style="float: left;margin-left: 10%;">
                            <svg class="icon" aria-hidden="true" style="background-image: url(../imgs/img_ranking.png);background-size: 100% 100%">

                                <!--　　  <use xlink:href="#icon-qushitu"></use>-->
                            </svg>
                        </span>
                <span style="float: left;font-size: large;margin-left: 0.857em;" id="youqushi"></span>

            </div>

        </div>

    </div>
    <div class="row" style="height: 90%;text-align: center;">

        <!--tab-->
        <div id="tab" class="row" style="width: 80%;border-radius: 3em 3em 3em 3em / 3em 3em;box-shadow: 1px 1px 1px 1px #1899FA;margin-left: 10%;padding: 2px 5px 2px 5px;position: relative;z-index: 100">
            <div id="tab1" class="col-xs-4" style="height:30px;line-height:30px;border-radius: 3em 3em 3em 3em / 3em 3em;background-color: #1899FA;color:#ffffff;">周</div>
            <div id="tab2" class="col-xs-4" style="height:30px;line-height:30px;border-radius: 3em 3em 3em 3em / 3em 3em;">月</div>
            <div id="tab3" class="col-xs-4" style="height:30px;line-height:30px;border-radius: 3em 3em 3em 3em / 3em 3em;">年</div>
        </div>
        <!--折线图-->
        <div class="row" style="margin-left: 5%;height: 40%;">
            <div id="echart1" style="height:100%;width: 90%;margin-top: -1.5em;z-index: 1"></div>
        </div>

        <!--table-->
        <div class="row" style="height: 35%;position: relative;">
            <div style="width:100%;position: absolute;padding: 10px 30px 0px 30px; ">
                <table id="table1"></table>
            </div>
        </div>

    </div>
</div>
</body>


<script type="text/javascript">
    
    function getQueryString(name) {
        var reg = new RegExp('(^|&)' + name + '=([^&]*)(&|$)', 'i');
        var r = window.location.search.substr(1).match(reg);
        if (r != null) {
            return unescape(r[2]);
        }
        return null;
    }
    
    $(document).ready(function () {
        //alert($(window).height()); //浏览器当前窗口可视区域高度
        //alert($(document).height()); //浏览器当前窗口文档的高度
        document.getElementsByTagName('body')[0].style.height = $(window).height() + 'px';
        document.getElementsByTagName('body')[0].style.width = $(window).width() + 'px';
        //var jsons = '{"cityName":"长沙","s_id":"B08I00130"}';
        var purl="http://111.8.20.247:89/api/apph5api/";
        //var purl = "http://10.254.204.130:89/api/apph5api/";
        var apiUrl = purl + "getkeywherep";
        var indid = getQueryString("s_id");
        var cityname = decodeURI(escape(getQueryString("cityName")));
        $("#youqushi").html(cityname + '趋势');
        var detailurl = purl + "getkeywhereidetailcity?S_id=" + indid + "";
        var urldetail = purl + "getkeywhereidetail?CITY_NAME=" + cityname + "&S_id=" + indid + "";

        $.ajax({
            type: "GET",
            url: urldetail,
            dataType: "jsonp",
            success: function (res) {
                var mydata = res.result;
                $("#inD_DATA").html(mydata.inD_DATA);


                // if (mydata.remak.length > 22) {
                //     var nuM = mydata.remak.length

                //     var oNe = mydata.remak.slice(0, 2);
                //     var tWo = mydata.remak.slice(22, nuM);
                //     $("#ReMake").html(oNe + "</br>" + tWo);


                // }
                // else {
                $("#ReMake").html(mydata.remak);
                var Height =   $("#ReMake").height();
                $('#chnageImg').css('top',Height/2);

                console.log(Height);
                //}


                $("#time").html(mydata.time);





                if(mydata.sorT_IDS == 0){
                    if (mydata.lasttime_data > 0) {
                        $("#lasttime_data").html("&nbsp;" + mydata.lasttime_data + '<svg class="icon" aria-hidden="true"><use xlink:href="#icon-jiantou3"></use></svg>');

                        $("#lasttime_data").css('color','#6EFB78');

                    }else if(mydata.lasttime_data == 0){
                        $("#lasttime_data").html("&nbsp;" + mydata.lasttime_data + '&nbsp;&nbsp;--');
                        $("#lasttime_data").css('color','#ccc');
                    } else {
                        $("#lasttime_data").html("&nbsp;" + mydata.lasttime_data + '<svg class="icon" aria-hidden="true"><use xlink:href="#icon-jiantou1-copy-copy"></use></svg>');
                        $("#lasttime_data").css('color','#FF0000');
                    }


                }else {
                    if (mydata.lasttime_data > 0) {
                        $("#lasttime_data").html("&nbsp;" + mydata.lasttime_data + '<svg class="icon" aria-hidden="true"><use xlink:href="#icon-jiantou1-copy-copy"></use></svg>');
                        $("#lasttime_data").css('color','#FF0000');
                    }else if(mydata.lasttime_data == 0){
                        $("#lasttime_data").html("&nbsp;" + mydata.lasttime_data + '&nbsp;&nbsp;--');
                        $("#lasttime_data").css('color','#ccc');
                    } else {
                        $("#lasttime_data").html("&nbsp;" + mydata.lasttime_data + '<svg class="icon" aria-hidden="true"><use xlink:href="#icon-jiantou3"></use></svg>');
                        $("#lasttime_data").css('color','#6EFB78');
                    }
                }





                if(mydata.iS_Degradation==0){

                    $("#iS_Degradation").css('opacity','0');
                    document.getElementById("iS_Degradation").style.display = "none";
                    $("#time").css('margin-left', '36%');

                }else{

                    document.getElementById("iS_Degradation").style.display = "block";
                    $("#iS_Degradation").css('opacity','1');

                }

                debugger;
            }
        });

        $.ajax({
            type: "GET",
            url: detailurl,
            dataType: "jsonp",
            success: function (data) {

                var result;
                result = data.result[0];

                var city = result.citY_NAME;
                var indId = result.s_id;



                // if (result.inD_DATA >= result.absolutE_THD) {
                //     document.getElementById("tishi").style.display = "none";
                // }

                $("#youini_data").html("<b style='color: #222222'>" + result.citY_NAME + "</b>&nbsp&nbsp " + result.inD_DATA);


                var firstUrl = apiUrl + "?id=gettheprovince_daydata&CITY_NAME=" + cityname + "&S_id=" + indId + "";
                var clickUrl = "";

                loadData(firstUrl,'');


                $("#tab").click(function (e) {
                    var ifRevose = false;
                    var tabId = e.target.id;
                    if (tabId == "tab1") {
                        clickUrl = apiUrl + "?id=gettheprovince_daydata&CITY_NAME=" + cityname + "&S_id=" + indId + "";
                    } else if (tabId == "tab2") {
                        clickUrl = apiUrl + "?id=gettheprovince_mothdata&CITY_NAME=" + cityname + "&S_id=" + indId + "";
                    } else {
                        clickUrl = apiUrl + "?id=gettheprovince_yeardata&CITY_NAME=" + cityname + "&S_id=" + indId + "";
                        ifRevose=true;
                    }

                    var divs = $("#tab").children('div');
                    for (var i = 0; i < divs.length; i++) {
                        if (tabId === divs[i].id) {
                            divs[i].style.height = '30px';
                            divs[i].style.lineHeight = '30px';
                            divs[i].style.borderRadius = '3em 3em 3em 3em / 3em 3em';
                            divs[i].style.backgroundColor = '#169BFA';
                            divs[i].style.color = '#ffffff';
                            loadData(clickUrl,tabId,ifRevose);
                        } else {
                            divs[i].removeAttribute('style');
                            divs[i].style.height = '30px';
                            divs[i].style.lineHeight = '30px';
                        }
                    }
                    //$("#table1").bootstrapTable('destroy');

                });

            }
        });

        function loadData(actionUrl,tabId,ifRevose) {
            var data = [];
            var yMaxDalue = 0;
            $.ajax({
                type: "GET",
                url: actionUrl,
                dataType: "jsonp",
                success: function (res) {
                    console.log(res,"data2")
                    debugger
                    if(ifRevose==true){
                        for (var i =  res.result.length-1; i >=0; i--) {
                            data.push(res.result[i]);
                            //console.log(data);
                        }

                    }else{
                        data=res.result;
                    }
                    //data=res.result;
                    // table
                    $("#table1").bootstrapTable('destroy');
                    $("#table1").bootstrapTable({
                        data: data,
                        classes: "table table-hover table-no-bordered table-striped",
                        search: false,
                        pagination: false,
                        showColumns: false,
                        showRefresh: false,
                        showToggle: false,
                        locale: "zh-CN",

                        striped: true,
                        columns: [//color:#A4A4A4
                            {
                                field: "time", title: "日期", width: "40%", height: '36', align: "center",
                                formatter: function (value, row, index) {


                                    if(tabId=="tab3"){
                                        var change =  row.time;
                                        return change;

                                    }
                                    else{
                                        var change =  row.time.replace(/年|月/g,"-").replace("日","");
                                        return change;
                                    }
                                }
                            },
                            {
                                field: "inD_DATA",
                                title: "指标值",
                                width: "30%",
                                align: "center",
                                formatter: function (value, row, index) {
                                    if (row.inD_DATA > yMaxDalue) {
                                        yMaxDalue = Math.ceil(row.inD_DATA);
                                    }
                                    return row.inD_DATA;
                                }
                            },
                            {
                                field: "lasttime_data",
                                title: "环比",
                                width: "30%",
                                align: "center",
                                formatter: function (value, row, index) {

                                    if(row.sorT_ID == 0){


                                        if(parseFloat(row.lasttime_data) < 0){
                                            row.lasttime_data ='<span style="color:#FF0000; ">'+row.lasttime_data+'<svg class="icon" aria-hidden="true" style="font-size: 15px;"> <use xlink:href="#icon-jiantou1-copy-copy"></use> </svg></span>';

                                        }else if(parseFloat(row.lasttime_data) >0){
                                            row.lasttime_data ='<span style="color:#6EFB78;" >'+row.lasttime_data+'<svg class="icon" aria-hidden="true" style="font-size: 15px;"> <use xlink:href="#icon-jiantou1"></use> </svg></span>';
                                        }else if(parseFloat(row.lasttime_data) ==null){
                                            row.lasttime_data = 0;
                                        }
                                        return row.lasttime_data;


                                    }
                                    else {


                                        if(parseFloat(row.lasttime_data) < 0){


                                            row.lasttime_data ='<span style="color:#6EFB78;" >'+row.lasttime_data+'<svg class="icon" aria-hidden="true" style="font-size: 15px;"> <use xlink:href="#icon-jiantou1"></use> </svg></span>';
                                        }else if(parseFloat(row.lasttime_data) >0){
                                            row.lasttime_data ='<span style="color:#FF0000; ">'+row.lasttime_data+'<svg class="icon" aria-hidden="true" style="font-size: 15px;"> <use xlink:href="#icon-jiantou1-copy-copy"></use> </svg></span>';

                                        }else if(row.lasttime_data ==null){
                                            row.lasttime_data = 0;
                                        }
                                        return row.lasttime_data;



                                    }

                                }
                            }
                        ],
                        onPostHeader: function () {
                            //修改表格背景颜色
                            var ths = document.getElementsByTagName('th');
                            for (var i = 0; i < ths.length; i++) {
                                ths[i].style.backgroundColor = '#169BFA';
                                ths[i].style.backgroundImage = 'none';

                            }
                        }
                    });
                    // echart
                    // xAxis yAxis data
                    var xData = [];
                    var yData = [];
                    var MaxDa;
                    var MinDa;
                    for (var i=data.length-1;i>=0;i--) {
                        //                            xData.push(data[i].time.replace(/年|月/g, "-").replace("日", ""));


                        if (tabId == "tab3") {
                            var showTime=[];
                            showTime.push(data[i].time);
                            xData.push(data[i].time.replace(/年|月/g, "-").replace("日", "").slice(5,7)+"月");
                            yData.push(data[i].inD_DATA);
                        } else {
                            xData.push(data[i].time.replace(/年|月/g, "-").replace("日", "").slice(5));
                            yData.push(data[i].inD_DATA);
                        }



                    }



                    MaxDa = (yData&&yData.length>0)?Math.max.apply(null,yData):0;

                    MinDa=(yData&&yData.length>0)?Math.min.apply(null,yData):100;




                    if( MinDa>100000){
                        var test1 =Math.floor(MinDa/10000);
                        MinDa= test1*10000;

                    }
                    else if( MinDa>10000){
                        var test1 =Math.floor(  MinDa/1000);
                        MinDa= test1*1000;

                    }
                    else if( MinDa>1000){
                        var test1 =Math.floor(  MinDa/100);
                        MinDa= test1*100 ;

                    }
                    else  if( MinDa>100){
                        var test1 =Math.floor(  MinDa/10);
                        MinDa= test1*10 ;
                    }
                    else if( MinDa>10){
                        var test1 =Math.floor(  MinDa/10);
                        MinDa= test1*10 ;
                    }
                    else if(MinDa>5){
                        MinDa= 5 ;
                    }
                    else if(MinDa>4){
                        MinDa= 4 ;
                    }
                    else if(MinDa>3){
                        MinDa= 3 ;
                    }
                    else if(MinDa>2){
                        MinDa= 2 ;
                    }
                    else  if(MinDa>1){
                        MinDa= 1 ;
                    }
                    else  if(MinDa>0.9){
                        MinDa= 0.9 ;
                    }
                    else  if(MinDa>0.8){
                        MinDa= 0.8 ;
                    }
                    else  if(MinDa>0.7){
                        MinDa= 0.7;
                    }
                    else  if(MinDa>0.6){
                        MinDa= 0.6 ;
                    }
                    else  if(MinDa>0.5){
                        MinDa= 0.5 ;
                    }
                    else  if(MinDa>0.4){
                        MinDa= 0.4 ;
                    }
                    else  if(MinDa>0.3){
                        MinDa= 0.3 ;
                    }
                    else  if(MinDa>0.2){
                        MinDa= 0.2 ;
                    }
                    else  if(MinDa>0.1){
                        MinDa= 0.1 ;
                    }
                    else  if(MinDa>0.09){
                        MinDa= 0.09 ;
                    }
                    else  if(MinDa>0.08){
                        MinDa= 0.08 ;
                    }
                    else  if(MinDa>0.07){
                        MinDa= 0.07 ;
                    }
                    else  if(MinDa>0.06){
                        MinDa= 0.06 ;
                    }
                    else  if(MinDa>0.05){
                        MinDa= 0.05 ;
                    }
                    else  if(MinDa>0.04){
                        MinDa= 0.04 ;
                    }
                    else  if(MinDa>0.03){
                        MinDa= 0.03 ;
                    }
                    else  if(MinDa>0.02){
                        MinDa= 0.02 ;
                    }
                    else  if(MinDa>0.01){
                        MinDa= 0.01 ;
                    }
                    else if(MinDa>0){
                        MinDa=0 ;
                    }
                    else if(MinDa>-0.01){
                        MinDa= -0.01 ;
                    }
                    else if(MinDa>-0.02){
                        MinDa= -0.02 ;
                    }
                    else if(MinDa>-0.03){
                        MinDa= -0.03 ;
                    }
                    else if(MinDa>-0.04){
                        MinDa= -0.04 ;
                    }
                    else if(MinDa>-0.05){
                        MinDa= -0.05 ;
                    }
                    else if(MinDa>-0.06){
                        MinDa= -0.06 ;
                    }
                    else if(MinDa>-0.07){
                        MinDa= -0.07 ;
                    }
                    else if(MinDa>-0.08){
                        MinDa= -0.08 ;
                    }
                    else if(MinDa>-0.09){
                        MinDa= -0.09 ;
                    }
                    else if(MinDa>-0.1){
                        MinDa= -0.1 ;
                    }
                    else if(MinDa>-0.2){
                        MinDa= -0.2 ;
                    }
                    else if(MinDa>-0.3){
                        MinDa= -0.3 ;
                    }
                    else if(MinDa>-0.4){
                        MinDa= -0.4 ;
                    }
                    else if(MinDa>-0.5){
                        MinDa= -0.5 ;
                    }else if(MinDa>-0.6){
                        MinDa= -0.6 ;
                    }
                    else if(MinDa>-0.7){
                        MinDa= -0.7 ;
                    }
                    else if(MinDa>-0.8){
                        MinDa= -0.8 ;
                    }
                    else if(MinDa>-0.9){
                        MinDa= -0.9 ;
                    }
                    else if(MinDa>-1){
                        MinDa= -1 ;
                    }
                    else if(MinDa>-2){
                        MinDa= -2 ;
                    }
                    else if(MinDa>-3){
                        MinDa= -3 ;
                    }
                    else if(MinDa>-4){
                        MinDa= -4 ;
                    }
                    else if(MinDa>-5){
                        MinDa= -5 ;
                    }
                    else if( MinDa>-10){
                        var test1 =Math.floor(  MinDa);
                        MinDa= test1 ;
                    }
                    else if( MinDa>-100){
                        var test1 =Math.floor(  MinDa/10);
                        MinDa= test1*10 ;
                    }
                    else if( MinDa>-1000){
                        var test1 =Math.floor(  MinDa/100);
                        MinDa= test1*100 ;
                    }
                    else if( MinDa>-10000){
                        var test1 =Math.floor(  MinDa/1000);
                        MinDa= test1*1000 ;
                    }
                    else if( MinDa>-100000){
                        var test1 =Math.floor(  MinDa/10000);
                        MinDa= test1*10000 ;
                    }
                    else{
                        MinDa= MinDa ;
                    }



                    if(MaxDa>100000){
                        var test1 =Math.ceil( MaxDa/10000);
                        MaxDa= test1*10000 ;
                    }
                    else if(MaxDa>10000){
                        var test1 =Math.ceil( MaxDa/1000);
                        MaxDa= test1*1000 ;
                    }
                    else if(MaxDa>1000){
                        var test1 =Math.ceil( MaxDa/100);
                        MaxDa= test1*100 ;
                    }
                    else  if(MaxDa>100){
                        var test1 =Math.ceil( MaxDa/10);
                        MaxDa= test1*10 ;
                    }
                    else if(MaxDa>10){
                        var test1 =Math.ceil( MaxDa/10);
                        MaxDa= test1*10 ;
                    }
                    else if(MaxDa>5){
                        MaxDa= 10 ;
                    }
                    else if(MaxDa>4){
                        MaxDa= 5 ;
                    }
                    else if(MaxDa>3){
                        MaxDa= 4 ;
                    }
                    else if(MaxDa>2){
                        MaxDa= 3 ;
                    }
                    else  if(MaxDa>1){
                        MaxDa= 2 ;
                    }
                    else if(MaxDa>0.9){
                        MaxDa= 1 ;
                    }
                    else if(MaxDa>0.8){
                        MaxDa= 0.9 ;
                    }
                    else if(MaxDa>0.7){
                        MaxDa= 0.8 ;
                    }
                    else if(MaxDa>0.6){
                        MaxDa= 0.7 ;
                    }
                    else if(MaxDa>0.5){
                        MaxDa= 0.6 ;
                    }
                    else if(MaxDa>0.4){
                        MaxDa= 0.5 ;
                    }
                    else if(MaxDa>0.3){
                        MaxDa= 0.4 ;
                    }
                    else if(MaxDa>0.2){
                        MaxDa= 0.3 ;
                    }
                    else if(MaxDa>0.1){
                        MaxDa= 0.2 ;
                    }
                    else if(MaxDa>0.09){
                        MaxDa= 0.1 ;
                    }
                    else if(MaxDa>0.08){
                        MaxDa= 0.09 ;
                    }
                    else if(MaxDa>0.07){
                        MaxDa= 0.08 ;
                    }
                    else if(MaxDa>0.06){
                        MaxDa= 0.07 ;
                    }
                    else if(MaxDa>0.05){
                        MaxDa= 0.06 ;
                    }
                    else if(MaxDa>0.04){
                        MaxDa= 0.05 ;
                    }
                    else if(MaxDa>0.03){
                        MaxDa= 0.04 ;
                    }
                    else if(MaxDa>0.02){
                        MaxDa= 0.03 ;
                    }
                    else if(MaxDa>0.01){
                        MaxDa= 0.02 ;
                    }
                    else if(MaxDa>0){
                        MaxDa=0.01 ;
                    }else if(MaxDa>-0.01){
                        MaxDa= 0 ;
                    }
                    else if(MaxDa>-0.02){
                        MaxDa= -0.01 ;
                    }
                    else if(MaxDa>-0.03){
                        MaxDa= -0.02 ;
                    }
                    else if(MaxDa>-0.04){
                        MaxDa= -0.03 ;
                    }
                    else if(MaxDa>-0.05){
                        MaxDa= -0.04 ;
                    }
                    else if(MaxDa>-0.06){
                        MaxDa= -0.05 ;
                    }
                    else if(MaxDa>-0.07){
                        MaxDa= -0.06 ;
                    }
                    else if(MaxDa>-0.08){
                        MaxDa= -0.07 ;
                    }
                    else if(MaxDa>-0.09){
                        MaxDa= -0.08 ;
                    }
                    else if(MaxDa>-0.1){
                        MaxDa= -0.09 ;
                    }
                    else if(MaxDa>-0.2){
                        MaxDa= -0.1 ;
                    }
                    else if(MaxDa>-0.3){
                        MaxDa= -0.2 ;
                    }
                    else if(MaxDa>-0.4){
                        MaxDa= -0.3 ;
                    }
                    else if(MaxDa>-0.5){
                        MaxDa= -0.4 ;
                    }
                    else if(MaxDa>-0.6){
                        MaxDa= -0.5 ;
                    }
                    else if(MaxDa>-0.7){
                        MaxDa= -0.6 ;
                    }
                    else if(MaxDa>-0.8){
                        MaxDa= -0.7 ;
                    }
                    else if(MaxDa>-0.9){
                        MaxDa= -0.8 ;
                    }
                    else if(MaxDa>-1){
                        MaxDa= -0.9 ;
                    }
                    else if(MaxDa>-2){
                        MaxDa= -1 ;
                    }
                    else if(MaxDa>-3){
                        MaxDa= -2 ;
                    }
                    else if(MaxDa>-4){
                        MaxDa= -3 ;
                    }
                    else if(MaxDa>-5){
                        MaxDa= -4 ;
                    }
                    else if(MaxDa>-10){
                        var test1 =Math.floor( MaxDa);
                        MaxDa= test1 ;
                    }
                    else if(MaxDa>-100){
                        var test1 =Math.floor( MaxDa/10);
                        MaxDa= test1*10 ;

                    }
                    else if(MaxDa>-1000){
                        var test1 =Math.floor( MaxDa/100);
                        MaxDa= test1*100 ;

                    }
                    else if(MaxDa>-10000){
                        var test1 =Math.floor( MaxDa/1000);
                        MaxDa= test1*1000 ;

                    }
                    else if(MaxDa>-100000){
                        var test1 =Math.floor( MaxDa/10000);
                        MaxDa= test1*10000 ;

                    }
                    else{

                        MaxDa=MaxDa ;
                    }




                    echarts.dispose(document.getElementById('echart1'));
                    var myChart = echarts.init(document.getElementById('echart1'));
                    var startPercent = xData.length>12 ? 50:0
                    var endPercent = xData.length >12? 100:100;

                    var Middle;
                    if( (MinDa+MaxDa)>0){
                        Middle= (MinDa+MaxDa)/2;
                        option = {
                            tooltip: {
                                show: true,
                                trigger: 'axis',
                            },
                            grid: {
                                right:'10%',
                                width:'78%',
                            },
                            xAxis: {
                                type: 'category',
                                boundaryGap: false,
                                data: xData,
                                axisLine: {
                                    show: false
                                },
                                axisLabel: {
                                    interval: 0,
                                    rotate: 45
                                },
                                splitLine: {
                                    show: false
                                }
                            },
                            yAxis: {
                                type: 'value',
                                min: MinDa,
                                max:MaxDa,
                                interval: Middle,
                                splitNumber: 1,
                                splitLine: {
                                    show: true,
                                    lineStyle: {
                                        type: 'solid',
                                        color: '#d4d4d4',//左边线的颜色
                                        opacity: 0.2,
                                        width: '1'//坐标线的宽度
                                    }
                                },//去除网格线
                                axisLine: {
                                    show: false
                                }
                            },
                            dataZoom: [//给x轴设置滚动条

                                {
                                    type: 'inside',
                                    show: true,
                                    zoomLock: true,
                                    xAxisIndex: [0],
                                    start: startPercent,//默认为1
                                    end: endPercent
                                }
                            ],
                            series: [{
                                data: yData,
                                smooth: true,
                                type: 'line',
                                symbol: 'circle',
                                //symbolSize:10,
                                lineStyle: {
                                    color: '#79C5FC'
                                },
                                itemStyle: {
                                    color: '#79C5FC'
                                },
                                areaStyle: {
                                    color: {
                                        type: 'linear',
                                        x: 0,
                                        y: 0,
                                        x2: 0,
                                        y2: 1,
                                        colorStops: [{
                                            offset: 0, color: '#79C5FC' // 0% 处的颜色
                                        }, {
                                            offset: 1, color: 'White' // 100% 处的颜色
                                        }],
                                        globalCoord: false // 缺省为 false
                                    }
                                },
                            }]
                        };

                    }
                    else{
                        Middle= false;
                        option = {
                            tooltip: {
                                show: true,
                                trigger: 'axis',
                            },
                            grid: {
                                right:'10%',
                                width:'78%',
                            },
                            xAxis: {
                                type: 'category',
                                boundaryGap: false,
                                data: xData,
                                axisLine: {
                                    show: false
                                },
                                axisLabel: {
                                    interval: 0,
                                    rotate: 45
                                },
                                splitLine: {
                                    show: false
                                }
                            },
                            yAxis: {
                                type: 'value',
                                min: MinDa,
                                max:MaxDa,
                                splitNumber: 1,
                                splitLine: {
                                    show: true,
                                    lineStyle: {
                                        type: 'solid',
                                        color: '#d4d4d4',//左边线的颜色
                                        opacity: 0.2,
                                        width: '1'//坐标线的宽度
                                    }
                                },//去除网格线

                                axisLine: {
                                    show: false
                                }
                            },
                            dataZoom: [//给x轴设置滚动条

                                {
                                    type: 'inside',
                                    show: true,
                                    zoomLock: true,
                                    xAxisIndex: [0],
                                    start: startPercent,//默认为1
                                    end: endPercent
                                }
                            ],
                            series: [{
                                data: yData,
                                smooth: true,
                                type: 'line',
                                symbol: 'circle',
                                //symbolSize:10,
                                lineStyle: {
                                    color: '#79C5FC'
                                },
                                itemStyle: {
                                    color: '#79C5FC'
                                },
                                areaStyle: {
                                    color: {
                                        type: 'linear',
                                        x: 0,
                                        y: 0,
                                        x2: 0,
                                        y2: 1,
                                        colorStops: [{
                                            offset: 0, color: '#79C5FC' // 0% 处的颜色
                                        }, {
                                            offset: 1, color: 'White' // 100% 处的颜色
                                        }],
                                        globalCoord: false // 缺省为 false
                                    }
                                },
                            }]
                        };

                    }

                    myChart.setOption(option);
                }
            });

        }

        $("#tishi").click(function (e) {
            var url = "shilingdao";
            turnTo(url);
        });
        function turnTo(url) {
            if (window.htmlView) {
                window.htmlView.redirectToPage(url);
            } else {
                window.location.href = url;
            }
        }


    });
</script>
</html>

